Repository navigation
fix: prevent PostgreSQL Remote OOM (#618), restore Kafka unauth detection (#615), and fix Set-Cookie POC search (#339) - #621
Merged
Conversation
…afka unauth detection, and fix case-insensitive Set-Cookie POC search
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes three reported bugs with targeted regression tests:
PostgreSQL Remote OOM (
plugins/services/postgresql.go) — Fixes [Bug] Remote OOM #618github.com/lib/pqallocatesmake([]byte, n)directly from the peer-controlled 4-byte wire length without an upper bound (e.g., anHTTP/response allocates ~1.41 GB and crashes the process; a malicious honeypot can request 4 GB per connection).probePostgreSQLWire(standard 8-byte SSLRequest pre-check) to reject non-PostgreSQL/HTTP services upfront.lib/pqconnections viapq.NewConnector+safePGDialer/safePGConn(also routing PostgreSQL throughsession.DialTCPfor proxy/rate-limit support), enforcing a hard 4 MB per-message wire length bound before bytes reachlib/pq.HTTP/1.1responses and a malicious 4 GB honeypot frame.Kafka Unauthorized Access False Negative (
plugins/services/kafka.go) — Fixes [Accuracy] Fscan 2.2.2 漏报 Kafka 未授权访问(被误报为未发现弱密码) #615testUnauthorizedAccessbefore credential brute-forcing: probesApiVersions+Metadata(v0) and validates that the response contains at least one valid broker entry before reporting unauthorized access.kafka_unauthlocalization entries (zh.yaml,en.yaml) and unit testTestKafkaDetectsUnauthorizedAccess.POC
Set-Cookie:Search Failure (webscan/lib/poc_executor.go) — Fixes Cookie问题 #339ParseResponsenormalizes HTTP header keys to lowercase (set-cookie), causing case-sensitivesearch: Set-Cookie:(?P<cookie>.*?)rules to fail and abort subsequent chained rules.Set-Cookie:search patterns and applyoptimizeCookiesregardless of case.TestDoSearchMatchesCaseInsensitiveSetCookieHeader.Verification
go test -race ./plugins/services ./webscan/lib ./common/i18n